package cn.cdu.medical.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Id;
import java.util.Date;

@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "medical_record_revision")
@TableName("medical_record_revision")
@Schema(description = "病历修订记录")
public class MedicalRecordRevision {

    @Id
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "病历ID")
    @Column(name = "record_id", length = 32)
    private String recordId;

    @Schema(description = "修改字段名")
    @Column(name = "field_name", length = 50)
    private String fieldName;

    @Schema(description = "原值")
    @Column(name = "old_value", columnDefinition = "TEXT")
    private String oldValue;

    @Schema(description = "新值")
    @Column(name = "new_value", columnDefinition = "TEXT")
    private String newValue;

    @Schema(description = "创建人")
    @Column(name = "create_by", length = 255)
    private String createBy;

    @Schema(description = "创建时间")
    @Column(name = "create_time")
    private Date createTime;

    @Schema(description = "原内容")
    @Column(name = "original_content", columnDefinition = "TEXT")
    private String originalContent;

    @Schema(description = "修改后内容")
    @Column(name = "revised_content", columnDefinition = "TEXT")
    private String revisedContent;

    @Schema(description = "修订内容")
    @Column(name = "revision_content", columnDefinition = "TEXT")
    private String revisionContent;

    @Schema(description = "删除标记")
    @Column(name = "del_flag")
    private Integer delFlag = 0;
} 